package com.zhaocaimao.xiaohashu.auth.controller;

import com.zhaocaimao.framework.biz.operationlog.aspect.ApiOperationLog;
import com.zhaocaimao.framework.common.response.Response;
import com.zhaocaimao.xiaohashu.auth.model.vo.user.UserLoginReqVO;
import com.zhaocaimao.xiaohashu.auth.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 *
 * @author: zhaobin
 * @date: 2025-09-11 19:51:07
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;

    @PostMapping("/login")
    @ApiOperationLog(description = "用户登录/注册")
    public Response<String> loginAndRegister(@RequestBody @Validated UserLoginReqVO userLoginReqVO){
        return userService.loginAndRegister(userLoginReqVO);
    }

    @PostMapping("/logout")
    @ApiOperationLog(description = "用户登出")
    public Response<?> logout(){
        // todo 账号登录逻辑待实现
        return Response.success();
    }




}
